<template>
	<view class="treaty">
		<rich-text :nodes="info.content"></rich-text>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				info: ''
			};
		},
		methods: {
		  getInfo(id){
			  this.$get(this.$api.newInfo, {id:id}, res => {
			  	let data = res.data;
			  	if (data.code == 1) {
					
					uni.setNavigationBarTitle({
						title:data.data.title
					})
					
					if(data.data.content){
						
						data.data.content = this.$formatRichText(data.data.content).replace(/src="\//g,
							'src="' + getApp().globalData
							.imgRemote + '/');
					}
					
			  		this.info = data.data;
			  
			  	}
			  });
		  }
		},
		onLoad(e) {
			this.getInfo(e.id);
		},
		onShow() {
			
		}
	}
</script>

<style>
	page {
		background: white;
	}

	.treaty {
		padding: 10rpx 20rpx;
	}
</style>
